package com.qianf.qfoffice.service.impl;


import com.github.pagehelper.PageHelper;
import com.qianf.qfoffice.dao.WeekDao;
import com.qianf.qfoffice.entity.Week;
import com.qianf.qfoffice.service.WeekService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WeekServiceImpl implements WeekService {

    @Autowired
    private WeekDao weekDao;


    @Override
    public List<Week> findAllWeek(Integer page,Integer limit) {

        PageHelper.startPage(page,limit);

        return weekDao.findAllWeek();
    }

    @Override
    public int addWeek(Week week) {
        return weekDao.addWeek(week);
    }

    @Override
    public int updateWeekById(Week week) {
        return weekDao.updateWeekById(week);
    }

    @Override
    public int deleteWeekById(int id) {
        return weekDao.deleteWeekById(id);
    }
}
